import {customeStruct} from '../utils';
const itf = customeStruct.interface;
export const InitData = itf({
    payload: itf({
        isDealerUser: 'boolean',
        enterprise: itf({
            id: 'string',
            name: 'string',
            code: 'string'
        }),
        brands: [itf({
            id: 'string',
            name: 'string',
            code: 'string'
        })],
        types: [
            itf({
                id: 'string',
                typeCode: 'string',
                typeName: 'string',
                creditCode: 'string',
                creditDescribe: 'string? | null',
                orderReasonCode: 'string? | null',
                orderReason: 'string? | null'
            })
        ]
    })
});
const defaultProps = {
    id: 'string',
    code: 'string',
    dealerCode: 'string',
    dealerName: 'string? | null',
    typeName: 'string? | null',
    status: 'number',
    orderReason: 'string? | null',
    totalFee: 'number? | null',
    creditCode: 'string? | null',
    creditDescribe: 'string? | null',
    orderReasonCode: 'string? | null',
    requiredArrivedDate: 'datetime? | null',
    createTime: 'datetime? | null',
    remark: 'string? | null',
    rowVersion: 'string',
    options: ['string']
};
export const List = itf({
    payload: itf({
        content: [itf(defaultProps)],
        totalElements: 'number'
    })
});
export const Detail = itf({
    payload: itf(
        Object.assign(
            {
                brandId: 'string',
                raisingRate: 'number? | null',
                warehouseId: 'string',
                warehouseName: 'string',
                dealerId: 'string? | null',
                typeId: 'string? | null',
                creatorName: 'string? | null',
                createTime: 'datetime? | null',
                modifierName: 'string? | null',
                modifyTime: 'datetime? | null',
                submitterName: 'string? | null',
                submitTime: 'datetime? | null',
                confirmorName: 'string? | null',
                confirmTime: 'datetime? | null',
                abandonerName: 'string? | null',
                abandonTime: 'datetime? | null',
                returnerName: 'string? | null',
                returnTime: 'datetime? | null',
                details: [
                    itf({
                        partId: 'string',
                        partCode: 'string? | null',
                        partName: 'string? | null',
                        planQuantity: 'number',
                        unit: 'string? | null',
                        taxPrice: 'number? | null',
                        minPackSize: 'number? | null'
                    })
                ],
                shipmentDetails: [
                    itf({
                        code: 'string',
                        partId: 'string',
                        partCode: 'string',
                        partName: 'string? | null',
                        shipQuantity: 'number',
                        confirmQuantity: 'number? | null',
                    })
                ],
            },
            defaultProps
        )
    )
});
export const Dealer = itf({
    payload: itf({
        content: [
            itf({
                id: 'string',
                code: 'string',
                name: 'string',
                branchCode: 'string',
                provinceName: 'string? | null',
                cityName: 'string? | null',
                countyName: 'string? | null',
                contactName: 'string? | null',
                contactPhone: 'string? | null',
                address: 'string? | null',
            })
        ],
        totalElements: 'number? | null'
    })
});
export const Part = itf({
    payload: itf({
        content: [
            itf({
                id: 'string',
                code: 'string',
                name: 'string',
                unit: 'string',
                minPackSize: 'number? | null',
                isOrderable: 'boolean? | null',
                wholeSalePrice: 'number? | null',
                retailGuidePrice: 'number? | null',
            })
        ],
        totalElements: 'number'
    })
});


export const RaisingRate = itf({
    payload: itf({
        raisingRate: 'number? | null',
        warehouseId: 'string',
        warehouseName: 'string',
        warehouses: [itf({
            id: 'string',
            name: 'string',
        })]
    })
});
